const weatherService = require('./services/weatherService');

async function testWeatherAPI() {
  try {
    console.log('测试天气API...');
    const weatherData = await weatherService.getWeather('北京');
    console.log('天气API测试成功:', JSON.stringify(weatherData, null, 2));
  } catch (err) {
    console.error('天气API测试失败:', err.message);
    console.log('\n解决方案:');
    console.log('1. 确保和风天气API Key有效且已启用');
    console.log('2. 检查网络连接是否正常');
    console.log('3. 确认城市名称是否正确');
  }
}

testWeatherAPI();